﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH5_2004A.Shopping.Domain
{
    [Table("tb_spu")]
    public class SPUModel : AuditField<Guid>
    {
        public string Name { get; set; }
        public int CategoryId { get; set; } //分类
        public int BrandId { get; set; } //品牌
        public bool IsUp { get; set; } = true;//默认上架
        public string? Description { get; set; } //商品详情介绍
    }


    [Table("tb_sku")]
    public class SKUModel : AuditField<Guid>
    {
        public Guid SPUId { get; set; }
        public string Name { get; set; }
        public string MasterImg { get; set; } //主图。其它的图片在图片表中
        public string SpecsJson { get; set; } //规格json格式（后台代码处理）
        public decimal? InPrice { get; set; } //进价
        public decimal SalePrice { get; set; } //售价
        public int StockTotal { get; set; } = 0; //累计库存（每次添加商品，这个数累加）
        public int ValidStock { get; set; } = 0;//有效库存
        public int LockStock { get; set; } = 0;//锁定库存
        public int Sales { get; set; } = 0; //累计销售数量
        public bool IsUp { get; set; } = true;//默认上架

    }
}
